package com.ruoyi.web.controller.applet.controller;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.google.common.collect.Maps;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.SysDictData;
import com.ruoyi.system.service.ISysDictTypeService;

@Controller
@RequestMapping("/applet/dict")
public class DictController {

	@Autowired
	private ISysDictTypeService dictTypeService;

	@PostMapping("/getDictData")
	@ResponseBody
	public AjaxResult getDictData(String type) {
		Map<String, Object> map = Maps.newConcurrentMap();
		List<SysDictData> dictDatas = dictTypeService.selectDictDataByType(type);
		map.put("dictDatas", dictDatas);
		return AjaxResult.success("操作成功", map);
	}
}
